/**
 * Create by yxk at 2020/6/12
 */
import request from '@/utils/request'

/**
 * 盘点新建/编辑
 */
export function jxcInventoryAddOrUpdateAPI(data, isUpdate = false) {
  return request({
    url: 'jxcInventory/addOrUpdate' + (isUpdate ? '/update' : '/add'),
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 盘点详情
 */
export function jxcInventoryQueryByIdAPI(data) {
  return request({
    url: `jxcInventory/queryById/${data.label}`,
    method: 'post',
    data: data
  })
}

/**
 * 盘点删除
 */
export function jxcInventoryDeleteByIdsAPI(data) {
  return request({
    url: 'jxcInventory/deleteByIds',
    method: 'post',
    data: data
  })
}

/**
 * 盘点作废
 */
export function jxcInventorySetStateByIdsAPI(data) {
  return request({
    url: 'jxcInventory/setStateByIds',
    method: 'post',
    data: data
  })
}

/**
 * 盘点-入库单
 */
export function jxcInventoryRecordAddOrUpdateAPI(data) {
  return request({
    url: 'jxcInventoryRecord/addOrUpdate',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 盘点-入库单-自动编号规则
 */
export function jxcInventoryRecordAutomaticAPI(data) {
  return request({
    url: 'jxcInventoryRecord/automatic',
    method: 'post',
    data: data
  })
}

/**
 * 盘点-待盘点入库的产品
 */
export function jxcInventoryQueryRecordListAPI(data) {
  return request({
    url: 'jxcInventoryRecord/queryJxcInventoryRecordList',
    method: 'post',
    data: data
  })
}

/**
 * 盘点-查看已经盘点入库的产品
 */
export function jxcInventoryQueryStateRecordListAPI(data) {
  return request({
    url: 'jxcInventoryRecord/queryStateJxcInventoryRecordList',
    method: 'post',
    data: data
  })
}

/**
 * 盘点-盈亏作废
 */
export function jxcInventoryRecordSetStateByIdsAPI(data) {
  return request({
    url: '/jxcInventoryRecord/setStateByIds',
    method: 'post',
    data: data
  })
}

